﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WordSmith_V1.Library.Model;

namespace WordSmith_V1.ViewModel
{
    public class UserFollowBooksViewModel
    {
        public UserFollowBooksViewModel()
        {
            FollowBooks = new List<FollowBooksViewModel>();
            Books = new List<Book>();
        }

      /*  public UserFollowBooksViewModel(List<Book> books)
        {
            FollowBooks = new List<FollowBooksViewModel>();
            if (books != null && books.Count > 0)
            {
                foreach (var book in books)
                {
                    FollowBooksViewModel i = new FollowBooksViewModel();
                    i.book = book;
                    i.Interested = false;
                    // i.Genre = DB
                    FollowBooks.Add(i);
                }
            }

        }*/
        public List<Book> Books
        {
           // get;
            set
            {
                
                if (value != null && value.Count > 0)
                {
                    foreach (var book in value)
                    {
                        FollowBooksViewModel i = new FollowBooksViewModel();
                        i.book = book;
                        i.Interested = false;
                        // i.Genre = DB
                        FollowBooks.Add(i);
                    }
                }
            }
        }
        public List<FollowBooksViewModel> FollowBooks { get; set; }
    }
        public class FollowBooksViewModel
        {
            public bool Interested { get; set; }

            public Book book { get; set; }

            
           //TODO add Genre
           // public Genre Genre { get; set; }

        }
    
}